<!doctype html>
<html>
<head>
<meta charset="utf-8">

<link href="../css/e-style.css" rel='stylesheet' type='text/css'>

<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="../tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
    selector: "textarea"
 });
</script>
<?php

include('../php/db.php');

if ($_SESSION['login'] == NULL)
{
 header("Location: ../index.php");	
}
else
{
$login = $_SESSION['login'];

$userid = mysql_query("SELECT * FROM `flss`.`accounts` WHERE `user` = '$login'");
while($rowshow = mysql_fetch_array($userid))
{
	$getid = $rowshow['account_id'];
}
$getcname = mysql_query("SELECT * FROM `flss`.`employer` WHERE `employer_id` = '$getid' ") or die(mysql_error);
$getcname2 = mysql_query("SELECT * FROM `flss`.`employer` WHERE `employer_id` = '$getid' ") or die(mysql_error);
$getcname3 = mysql_query("SELECT * FROM `flss`.`employer` WHERE `employer_id` = '$getid' ") or die(mysql_error);

$getrow2 = mysql_query("SELECT * FROM `flss`.`employer` WHERE `employer_id` = '$getid' ") or die(mysql_error);
$getrow3 = mysql_query("SELECT * FROM `flss`.`employer` WHERE `employer_id` = '$getid' ") or die(mysql_error);
$getrow4 = mysql_query("SELECT * FROM `flss`.`e_snap` WHERE `e_id` = '$getid' ") or die(mysql_error);
$getrow5 = mysql_query("SELECT * FROM `flss`.`e_snap` WHERE `e_id` = '$getid' ") or die(mysql_error);
$getrow6 = mysql_query("SELECT * FROM `flss`.`e_snap` WHERE `e_id` = '$getid' ") or die(mysql_error);
$getrow7 = mysql_query("SELECT * FROM `flss`.`e_snap` WHERE `e_id` = '$getid' ") or die(mysql_error);
$getrow8 = mysql_query("SELECT * FROM `flss`.`e_snap` WHERE `e_id` = '$getid' ") or die(mysql_error);
$getrow9 = mysql_query("SELECT * FROM `flss`.`e_snap` WHERE `e_id` = '$getid' ") or die(mysql_error);
$getrow10 = mysql_query("SELECT * FROM `flss`.`e_snap` WHERE `e_id` = '$getid' ") or die(mysql_error);

$countjob = mysql_query("SELECT Count(*) as Count FROM `flss`.`job_order` where `employer_ID` = '$getid' ") or die(mysql_error());
$count = mysql_fetch_assoc($countjob);
$cjob = $count['Count'];

$getalljob = mysql_query("SELECT * FROM `flss`.`job_order` where `employer_ID` = '$getid' ") or die(mysql_error());



while($employerrowphoto = mysql_fetch_array($getcname3))
{
  $clogo = $employerrowphoto['logo'];
  $ccover = $employerrowphoto['cover'];
}


$logo = empty($clogo) ? DEFAULT_LOGO : IMAGE_URL_SMALL.$clogo; 
$cover = empty($ccover) ? DEFAULT_COVER : IMAGE_URL_SMALL.$ccover;

$employer_notif = listEmployerNotif($getid);


}

?>

<title>

<?php  while ($cnameget = mysql_fetch_array($getcname2)) {
						 echo $cnameget['ename'];
    				}  ?> 

</title>
      
        
        
</head>
<body>
<?php
 include __DIR__ . "/../php/header.php";

?>

<div class="b-sub-container">
	<div class="b-content">
	<div class="b-image-upload">
    		<img id="companyCover" width = "960" height = "250" src="<?=$cover?>"/>
    		<form action="companyinfo.php" method="post" > 
       		<input style="top:-200px; left:30px;" type="submit" value="Update Info" class="updateinfo"> 
        	</form>
       </div>
    <div class="b-sub-content">
        <div class="b-company-logo">
		<img id="companyLogo" width = "150" height = "150" src="<?=$logo?>"/>
        </div>
		<div class="b-company-name-container">
    		<div class="b-company-name" >
        		<div  style="font-size:18px; margin-left:10px;" name="companyname">
					<?php  while ($row = mysql_fetch_array($getcname)) {
						 echo $row['ename'];
    				}  ?> 
                </div> 
        	</div>
		</div>
        <div class="b-company-overview-container">
        	<div class="b-company-overview">
        		<div class="b-company-overview-content">
					<div  class="b-company-overview-title" name="companyoverview"> Company Overview </div>
        			<div class="b-company-overview-context" name="companyoverviewcontext"> 
                    		<?php  while ($row2 = mysql_fetch_array($getrow2)) {
			 						echo $row2['description'];
    						}  ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="b-company-why-container">
        	<div class="b-company-why">
        		<div class="b-company-why-content">
                	<div class="b-company-why-title" name="companywhy"> Why Join Us </div>
        			<div class="b-company-why-context" name="companywhycontext">
                    		<?php  while ($row3 = mysql_fetch_array($getrow3)) {
			 						echo $row3['whyjoinus'];
    						}  ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="b-company-postedjobs-container">
       		<div class="b-company-postedjobs">
       			    <h2 style="margin-left:10px;">All Jobs from This Company</h2>
        				<span style="float:left; margin-left:10px; font-weight:bold; padding-bottom:5px;">Displaying <?php echo $cjob; ?> jobs</span>
                        <span style="float:right;">
                        	<div class="row">
                        		<div class="rPaging">
                            	</div>
                            </div>
                         </span>      
			 </div>
         </div>
         
         <div>
             <table class="tstyle">
                   <tr style="line-height: 34px;background: #F9F9F9;border-bottom: 1px solid #CCC;width: 640px;margin-top: 15px;font-weight: bold;">
                        <td style="width:100px; padding-left: 5px;" valign="top"><b>Date Posted</b></td>
                        <td style="width:420px; padding-left: 5px;" valign="top"><b>Job Title</b></td>
                        <td style="width:150px; padding-left: 5px;" valign="top"><b>Needed Applicant</b></td>
                        </tr>
                       <?php while($job = mysql_fetch_assoc($getalljob)) { ?>
                        <tr>
                        	<td>
                            <?php $result = $job['date_posted']; 
								$dtime = new DateTime($job['date_posted']);
								print $dtime->format("D, F d, Y");	
								?>
                            </td>
                        	<td style="font-weight: bold;"><?php 
							$jt = $job['Title'];
							$refid = $job['refid'];
                            ?>
							<a style="cursor:pointer;" href="Job/joborder.php?refid=<?php echo $refid; ?>" onClick="window.open(this.href,'popupwindow','left=200,top=50,width=1000,height=600,scrollbars=yes,menu=0,status=0'); return false;">  
							<?php
                            echo $jt; 
							?>
							</a> 
							</td>
                        	<td>
                            <?php echo $job['numapps']; ?>
                            </td>
                        </tr>
                        <?php } ?>
                        </table>
                       
         	</div>
    </div>
    
				    	

    <div class="b-company-right">
    	
        <div class="b-company-snap-container">
			<div class="b-company-snap">
            	<div class="b-company-snap-content">
                	<div  style="font-size:18px; margin-left:10px;" name="companysnap"> Company Snapshot </div>
                    	<div class="tstyle">
                        <table height="250">
                        <tr>
                        <td>Registration No: </td>
                        <td><?php  while ($row4 = mysql_fetch_array($getrow4)) {
						 echo $row4['Registration_No'];
    				}  ?>  </td>
                        </tr>
                        <tr>
                        <td>Industry: </td>
                        <td><?php  while ($row5 = mysql_fetch_array($getrow5)) {
						 echo $row5['Industry'];
    				}  ?>  </td>
                        </tr>
                        <tr>
                        <td>Company Size: </td>
                        <td><?php  while ($row6 = mysql_fetch_array($getrow6)) {
						 echo $row6['Company_size'];
    				}  ?>  </td>
                        </tr>
                        <tr>
                        <td>Working Hours: </td>
                        <td><?php  while ($row7 = mysql_fetch_array($getrow7)) {
						 echo $row7['Working_hours'];
    				}  ?>  </td>
                        </tr>
                        <tr>
                        <td>Dress Code: </td>
                        <td><?php  while ($row8 = mysql_fetch_array($getrow8)) {
						 echo $row8['Dresscode'];
    				}  ?>  </td>
                        </tr>
                        <tr>
                        <td>Benefits: </td>
                        <td><?php  while ($row9 = mysql_fetch_array($getrow9)) {
						 echo $row9['Benefits'];
    				}  ?>  </td>
                        </tr>
                        <tr>
                        <td>Spoken Language(s): </td>
                        <td><?php  while ($row10 = mysql_fetch_array($getrow10)) {
						 echo $row10['Spoken_language'];
    				}  ?>  </td>
                        </tr>


                        </table>
                        </div>
                </div>
            </div>
        </div>
        
        <div class="b-company-map-container">
        	<div class="b-company-map">
               <div class="b-company-map-content">
                <div  style="font-size:18px; margin-left:10px;" name="companyloc"> Company Location </div>	
                <div style="margin-top:10px; margin-left:10px;">
               	<?php
				$getmap = mysql_fetch_array(mysql_query("SELECT * FROM e_map WHERE employer_id = '$getid'"));
				echo $getmap['e_address'];
				?>
               </div>
             </div>
        </div>
        </div>
		<div class="b-company-notif-container">
      		<div class="b-company-notif">
                <div class="b-company-notif-content">
                       <div  style="font-size:18px; margin-left:10px;" name="companynotif"> Notifications
                       	
                       </div>
						<?php include 'employer_notif.php'; ?>
                      
					   
            	</div>
            </div>
         </div>    
    </div>	



</div>
</div>


		<div class="footer">
        	
            <div style="margin-top:20px; float:left; width:100%;">
            <center>
            
            <p>Copyright @ Famous Labor Supply Service Alright Reserve 2015</p>
            </center>
            </div>
        </div>   



</body>
</html>
